<?php
	App::import('Model','Client');

	class PortfolioTestCase extends CakeTestCase
	{
		var $fixtures = array('app.portfolio', 'app.currency', 'app.user');
				
		function testValidCreatePortfolioForUser()
		{
			$this->Portfolio =& ClassRegistry::init('Portfolio');
			$this->User =& ClassRegistry::init('User');
			
			$user = $this->User->findByUsername('TestUser');
			$portfolio = $this->Portfolio->createPortfolioForUser($user['User']['id']);  	
			
			$this->assertTrue($portfolio);
			$this->assertEqual(Configure::read('Currency.default'), $portfolio['Currency']['code']);
		}
		
		function testInvalidCreatePortfolioForUser()
		{
			$this->Portfolio =& ClassRegistry::init('Portfolio');

			$portfolio = $this->Portfolio->createPortfolioForUser(-99);  	
			
			$this->assertFalse($portfolio);
		}
	}
?>